﻿using System;
using LEET.LEETCommon;

namespace LEET.LEETCommon.Model
{
    public class Event_Pair : IEvent_Pair
    {
        private long timestamp;
        private string details;

        /*/// <summary>
        /// Initializes a new Event_Pair with null for the details and the 
        /// current time (in long format) as the timestamp.
        /// </summary>
        public Event_Pair() 
        {
            timestamp = long.Parse(System.DateTime.Now.ToLongTimeString());
            details = null;
        }*/

        /// <summary>
        /// Initializes a new Event_Pair with the contents of d for the 
        /// details and the current time (in long format) as the timestamp.
        /// </summary>
        /// <param name="d">
        /// The string representing the event.  This should be in valid TTL
        /// format as it will be directly output to the script later!
        /// </param>
        public Event_Pair(string d) 
        {
            timestamp = System.DateTime.Now.Ticks;
            details = d;
        }

        /// <summary>
        /// Property representing details.
        /// </summary>
        public string Details
        {
            get
            {
                return details;
            }
            set
            {
                details = value;
            }
        }

        /// <summary>
        /// Property representing the read-only timestamp attribute.
        /// </summary>
        public long Timestamp 
        {
            get 
            {
                return timestamp;
            }
        }

        public override string ToString()
        {
            return Details;
        }
    }
}